export default function formatDate(times) {
  if (times && typeof times === 'number') {
    let sec = Math.floor(times / 1000)
    let minute
    let hour
    if (sec < 60) {
      return `${sec}秒`
    } else if (sec < 3600) {
      minute = Math.floor(sec / 60)
      sec = sec % 60
      return `${minute}分${sec}秒`
    } else {
      hour = Math.floor(sec / 3600)
      minute = Math.floor((sec % 3600) / 60)
      sec = sec % 60
      return `${hour}时${minute}分${sec}秒`
    }
  } else {
    return times
  }
}
